﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ReportEmployee_Sales.ascx.cs" Inherits="ERP.Modules.Report.ReportEmployee_Sales" %>
<%-------------------------------%>
<ext:Hidden ID="FormatTypeReportEmployee_Sales" runat="server" />
<ext:Panel runat="server" Layout="Fit" Border="False" ID="PanelReportEmployee_Sales">
    <Content>
        <%--------------GridReportEmployee_Sales-----------------%>
        <ext:GridPanel
            ID="grReportEmployee_Sales"
            Cls="grid-double"
            runat="server"
            EnableColumnMove="true"
            Border="False">
            <Store>
                <%-------------StoreReportEmployee_Sales-----------------%>
                <ext:Store
                    ID="StoreReportEmployee_Sales"
                    runat="server"
                    OnReadData="StoreReportEmployee_Sales_RefreshData"
                    PageSize="20">
                    <Model>
                        <ext:Model ID="ModelReportEmployee_Sales" runat="server">
                            <Fields>
                                <ext:ModelField Name="FullName" Type="String" />
                                <ext:ModelField Name="Department_Name" Type="String" />
                                <ext:ModelField Name="Sell_DateBegin" Type="Date" />
                                <ext:ModelField Name="Sell_Code" Type="String" />
                                <ext:ModelField Name="Sales" Type="Float" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:RowNumbererColumn ID="RowNumbererColumn1" Text="STT" runat="server" Width="30" Align="Center" />
                    <ext:Column ID="Column2" runat="server" Text="Người bán hàng" Width="200" DataIndex="FullName"></ext:Column>
                    <ext:Column ID="Column1" runat="server" Text="Phòng ban" DataIndex="Department_Name" Width="200"></ext:Column>
                    <ext:DateColumn ID="Column3" runat="server" Text="Ngày bán" DataIndex="Sell_DateBegin" Format="dd-MM-yyyy" Width="85"></ext:DateColumn>
                    <ext:Column ID="Column5" runat="server" Text="Chứng từ bán" DataIndex="Sell_Code" Flex="1"></ext:Column>
                    <ext:Column ID="Column12" runat="server" Text="Doanh số" DataIndex="Sales" Width="200">
                        <Renderer Handler="return indMoney(value);" />
                    </ext:Column>
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:CheckboxSelectionModel ID="CheckboxSelectionModelReportEmployee_Sales" runat="server" Mode="Multi">
                    <Listeners>
                        <SelectionChange Handler="
                            if (selected.length == 0) {
                                #{btnEdit}.disable();
                                #{btnDel}.disable();
                                #{btnExport}.disable();
                            } else {
                                #{btnEdit}.enable();
                                #{btnDel}.enable();
                                #{btnExport}.enable();
                            }" />
                    </Listeners>
                </ext:CheckboxSelectionModel>
            </SelectionModel>
            <DockedItems>
                <ext:Toolbar ID="ToolbarTopMain" runat="server" Dock="Top">
                    <Items>
                        <ext:Button ID="btnExport" runat="server" Text="Xuất tập tin" Icon="Printer">
                            <Menu>
                                <ext:Menu ID="MenuMain" runat="server">
                                    <Items>
                                        <ext:MenuItem ID="MenuItemExportXML" runat="server" Text="XML" Icon="PageCode">
                                            <Listeners>
                                                <Click Handler="submitValue(#{grReportEmployee_Sales}, #{FormatTypeReportEmployee_Sales}, 'xml');" />
                                            </Listeners>
                                        </ext:MenuItem>
                                    </Items>
                                </ext:Menu>
                            </Menu>
                        </ext:Button>

                    </Items>
                </ext:Toolbar>
                <ext:Toolbar ID="ToolbarPagging" runat="server" Dock="Bottom" AnchorHorizontal="100%">
                    <Items>
                        <ext:TriggerField ID="txtSearch" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                            <Triggers>
                                <ext:FieldTrigger Icon="Search" />
                            </Triggers>
                            <DirectEvents>
                            </DirectEvents>
                        </ext:TriggerField>
                        <ext:PagingToolbar ID="PagingToolbarReportEmployee_Sales" runat="server" StoreID="StoreReportEmployee_Sales" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                    </Items>
                </ext:Toolbar>
            </DockedItems>
        </ext:GridPanel>
    </Content>
</ext:Panel>
